package com.ticket.serviceImpl;

import com.ticket.exception.ServiceException;
import com.ticket.pojo.ArrivalAtPort;
import com.ticket.service.IArrivalAtPortService;

import javax.persistence.Table;

public class ArrivalAtPortServiceImpl extends BaseServiceImpl implements IArrivalAtPortService {

	public ArrivalAtPort queryByFlightNoAndDate(String flightNumber, String flightDate) throws ServiceException {
		String sql = "select * from "
				+ ((Table) ArrivalAtPort.class.getAnnotation(Table.class)).name()
				+ " t where t.flt=? and date_format(t.sta,'%Y-%m-%d')=?";
		ArrivalAtPort arrivalAtPort = dbDAO.executeSQLForQuerySingle(sql, ArrivalAtPort.class, flightNumber, flightDate);
		return arrivalAtPort;
	}
}